package util;

import java.sql.Connection;
import java.sql.DriverManager;

public class DBUtil {
	public static final String url = "jdbc:mysql://127.0.0.1/myclass?characterEncoding=UTF-8";  
    public static final String name = "com.mysql.jdbc.Driver";  
    public static final String user = "root";  
    public static final String password = "123456";  
  
  
    public static Connection getConn() { 
        try {  
            Class.forName(name);
            Connection conn = DriverManager.getConnection(url, user, password);
            return conn;
        } catch (Exception e) {  
            e.printStackTrace();  
            return null;
        }  
    }  
  
}
